package com.example.hehecat.yuejian1.ui.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.hehecat.yuejian1.R;
import com.example.hehecat.yuejian1.mvp.model.api.Api;
import com.example.hehecat.yuejian1.mvp.model.bean.ActivityBean;
import com.squareup.picasso.Picasso;

public class ActivityListAdapter extends BaseQuickAdapter<ActivityBean, BaseViewHolder> {
    private Context context;

    public ActivityListAdapter(int layoutResId, Context context) {
        super(layoutResId);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, ActivityBean item) {

            helper.setText(R.id.item_name,item.getActivityname())
                    .setText(R.id.item_intro,String.valueOf(item.getIntro()))
                    .setText(R.id.item_date,item.getStartdate());

            Picasso.with(context).load(Api.IMG_URL+item.getActivitypic()).into((ImageView) helper.getView(R.id.master_pic));
        }
    }



